UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K8HMFb7OGz188m/K0+t9WDi1Zp+6gHPyGbo+b0D6igY='
WHERE
key_id = '36576082a7b86bd7ab17a150d627d24a72d87638d7e09d5bcc2fdf73ccafc009'
AND (
token = 'K8HMFb7OGz188m/K0+t9WDi1Zp+6gHPyGbo+b0D6igY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)