UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xyhhilzjsJ1blZEyducabGy3r4T+OOiR20Xw9SEZzAc=' 
WHERE 
  key_id = '7990e626865919a69fe3d59c6aaf35872986b471e61a4232f5ef4361248c1770' 
  AND (
    token = 'xyhhilzjsJ1blZEyducabGy3r4T+OOiR20Xw9SEZzAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023