UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dHgkDToGbKeS3gSdM3STmOLfvSSLCriejlVs3J6nSRw='
WHERE
key_id = '7ac67802760451809e24d65f98f96eb4168183c089b60b8149c14dc777754cae'
AND (
token = 'dHgkDToGbKeS3gSdM3STmOLfvSSLCriejlVs3J6nSRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)