UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NDzmiJzPgYOzRAddSU5oER5T9V4iE9ObGZHDsqF4dzs=' 
WHERE 
  key_id = 'f91acad3dd357a40ad2399cb76c6b66e57b62da884c385f5582312369e510200' 
  AND (
    token = 'NDzmiJzPgYOzRAddSU5oER5T9V4iE9ObGZHDsqF4dzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031