UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AJM0Rj027pvShV1yTIcBpBkmKY2FMVXcVolO1QTIHcM=' 
WHERE 
  key_id = '63febdf87b05ee3dccc6bef5641bd32fed940d1369ad820d2679f28cae502f73' 
  AND (
    token = 'AJM0Rj027pvShV1yTIcBpBkmKY2FMVXcVolO1QTIHcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050