UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZAAu0HyysHxuVP4/j9Carg01maEEPC+aVuz0ENdg/L4=' 
WHERE 
  key_id = '18f257d5234a8915d3a665fb0644509ffdb9d641be0cc141ca3af47402acb508' 
  AND (
    token = 'ZAAu0HyysHxuVP4/j9Carg01maEEPC+aVuz0ENdg/L4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067