UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VAuk5VbSMZWt82OhKLX8wTKeJvdxj+QjWB0UNCjtR5o='
WHERE
key_id = '3ca23ce6cb64fd7a0c46bfd298c49edbfacf77a022f8a4979972daad1a7775ed'
AND (
token = 'VAuk5VbSMZWt82OhKLX8wTKeJvdxj+QjWB0UNCjtR5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)