UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xe5z3Mqd5hatO/ENtK5x3XyNvbrhXcvayEZRXxyPMg4=' 
WHERE 
  key_id = '9eb6df162a2972cb2f0db41b8e1d64a8e047fca039a8cef3f7d0b74c4365452f' 
  AND (
    token = 'xe5z3Mqd5hatO/ENtK5x3XyNvbrhXcvayEZRXxyPMg4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020