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