UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'roMXvgwdHvmHuTRuCa74VQfb2IN4P0IE7TdWHTJbezM=' 
WHERE 
  key_id = '7db15bfcfcff7fdbdf758eb272180a0918b90f309041b096a9fe9579829a148e' 
  AND (
    token = 'roMXvgwdHvmHuTRuCa74VQfb2IN4P0IE7TdWHTJbezM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022