UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9UxBVNTD+gaGHyzluWlYmlqdZlrWTN1g6ymukq4VJQI=' 
WHERE 
  key_id = 'd69cdd157dfd8a018fd06f439804a482613a4b1f3aa2d614207d66ad6e56d4c8' 
  AND (
    token = '9UxBVNTD+gaGHyzluWlYmlqdZlrWTN1g6ymukq4VJQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00108