UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LKrWhQ/pc+YRTpyjWO9VKHVz4XXNg/48X8cRhJh9QHA=' 
WHERE 
  key_id = '1c2c3e3b5ca99327145c2307351ac463faebba89449c5fcb95a41888925845ea' 
  AND (
    token = 'LKrWhQ/pc+YRTpyjWO9VKHVz4XXNg/48X8cRhJh9QHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059