UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L0hNqMXFQa/igKzdJPlXjrI4QIG3V872y99Cw9E5/ds=' 
WHERE 
  key_id = '4c504e516247f474a625d8d98dac4006b7ee2de0361422e5b5fcd62e3b639498' 
  AND (
    token = 'L0hNqMXFQa/igKzdJPlXjrI4QIG3V872y99Cw9E5/ds=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039