UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EPpPSVYSDFbpwhAv6NR7gUnJULsXUbZZC4qv8w5X/tU=' 
WHERE 
  key_id = '12aba7edf8ee05beaea488873f6d2bbd92a82ff1b4b3a83f440e7d6d47aa0256' 
  AND (
    token = 'EPpPSVYSDFbpwhAv6NR7gUnJULsXUbZZC4qv8w5X/tU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044