UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'maa0TZRyXpE1TiBKOmJajliy14hC/uO0yd8L5pP+jqA=' 
WHERE 
  key_id = '88d25edd9cf929bfff50e816971cb8c57103cf4a9edf531d24c2837e22cd9604' 
  AND (
    token = 'maa0TZRyXpE1TiBKOmJajliy14hC/uO0yd8L5pP+jqA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041