UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B+x7aBg8Ho7D0b2OOjTdPtmdnsmx5eyhj5Z6ryxiQ/Y=' 
WHERE 
  key_id = '685e87ac12ef1798c4ed84a891fa19a84344be98dd1a8b81d059130f2c633f4d' 
  AND (
    token = 'B+x7aBg8Ho7D0b2OOjTdPtmdnsmx5eyhj5Z6ryxiQ/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031