UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '654AsqA8H0SQy+1g3p9IZmSBY/VeMhw4Id4ok5e1ULg=' 
WHERE 
  key_id = 'e07f585374303fe3507664964022d7814dd8cc79d604f3e3bbbb6e92422929d5' 
  AND (
    token = '654AsqA8H0SQy+1g3p9IZmSBY/VeMhw4Id4ok5e1ULg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021