UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gURdYom7RSNsd9p9oLRjbBzzsiUVtZ5wXL1ZxemymQ8=' 
WHERE 
  key_id = '68c995ca17e52caf6eedfb649a7c5145bf6cf6d4643698a131d3393e7c342dcc' 
  AND (
    token = 'gURdYom7RSNsd9p9oLRjbBzzsiUVtZ5wXL1ZxemymQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032