UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3wETZFWvKiHbUpfdeVWZpFaH4BZu0erTsBgHvvfMuDI=' 
WHERE 
  key_id = '2879c55f7f6b6d1a1af3817f3ba200df9efbd1f9662e3cf72ec1789dea7c71f5' 
  AND (
    token = '3wETZFWvKiHbUpfdeVWZpFaH4BZu0erTsBgHvvfMuDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029