UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6bP9J/J/L3VYPbux2dQapHC6mmmUlniBrdGo4X+IT30=' 
WHERE 
  key_id = '8cf39b6d2f55b274a2b75944655d0ff9cc960a476da83d10d424708e01dd73cc' 
  AND (
    token = '6bP9J/J/L3VYPbux2dQapHC6mmmUlniBrdGo4X+IT30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034