UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CdeMYy5T944fU2dSOoWlnhZgElnjPy/bWv7q/klclTw=' 
WHERE 
  key_id = '518159fcf2a09153256b820bfeba2b3a9aeb4310570572e9ec88697b9bbbd717' 
  AND (
    token = 'CdeMYy5T944fU2dSOoWlnhZgElnjPy/bWv7q/klclTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029