UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3fIR4cfsdeedlBjUlDQRTKSxuDnZm1+bzu5DCcnDH68='
WHERE
key_id = '0e6ab3420a7eaa7cd67fb3fe2e672088fd6e98f74fae1cb810ce3d61a780c89d'
AND (
token = '3fIR4cfsdeedlBjUlDQRTKSxuDnZm1+bzu5DCcnDH68='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)