UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+FejPAT/fbTcN4FvUs3IIHrn4SIt1cFLmzmQR2mDH6s=' 
WHERE 
  key_id = '8439fb1a7bef6db15b57e78c1ae4263a829b4146700f34e4a490d3f760cea19b' 
  AND (
    token = '+FejPAT/fbTcN4FvUs3IIHrn4SIt1cFLmzmQR2mDH6s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037