UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M2vckMns6xqLP8IM5cSfuInXMBEEuyx5QI/82lbH6p8=' 
WHERE 
  key_id = '0be46e98221a1ed455a9625fa8dbd1807f6fd4310eb11180c1aa3d395d374bd9' 
  AND (
    token = 'M2vckMns6xqLP8IM5cSfuInXMBEEuyx5QI/82lbH6p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037