UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zOlEqJOSJpWaIcg8UlmQuv7BDnQrbY9YrJEOphSFw7Q=' 
WHERE 
  key_id = '8b9604a90012965481bd72939f2185ddd270e6a6e56fdfc9a21b146427a46d60' 
  AND (
    token = 'zOlEqJOSJpWaIcg8UlmQuv7BDnQrbY9YrJEOphSFw7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030