UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MwBxx1AgbRT6Hzb8c/VtwW6MH1D3wY9YnWdaN+42wfs='
WHERE
key_id = '04121ea0a1dc9ac461c3c386d8fc6654cde95176289d75ad4d943d63e228d24e'
AND (
token = 'MwBxx1AgbRT6Hzb8c/VtwW6MH1D3wY9YnWdaN+42wfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)