UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hcx4DIM+Geeb89/vakU/kMV7osEp8m8IyIAHfwuDYCk=' 
WHERE 
  key_id = '809e0018a97015fa8aee0c7f8c27ff4e38357864f9487916cef9c6c1ee761f5f' 
  AND (
    token = 'hcx4DIM+Geeb89/vakU/kMV7osEp8m8IyIAHfwuDYCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025