UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YGtW38ojd5YwTSqQvt2FwG3lmmSpNw8K//E1Dn9MVzI='
WHERE
key_id = 'c3aaa10c8eede7cb590c352542842995b7d4f98f2c7cd4fdbe948eba2d85d553'
AND (
token = 'YGtW38ojd5YwTSqQvt2FwG3lmmSpNw8K//E1Dn9MVzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)