UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4Pfovr9oD9oYxcG6c3IwIEr4EEph0HtufZ65gfMw+7w=' 
WHERE 
  key_id = 'b283e1aa1c45ad5d0e015ebb7f7c03061b779bf6f7425bf4996fc253504dc24d' 
  AND (
    token = '4Pfovr9oD9oYxcG6c3IwIEr4EEph0HtufZ65gfMw+7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034