UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CNx4wzEXUgmo72s94F2Ss8K7FGIce3wHti72NJPsi0I='
WHERE
key_id = '4ffdf7dc228fdf7fe018f97092638390ecf23e54a8a23dc785b2a00a42e37cef'
AND (
token = 'CNx4wzEXUgmo72s94F2Ss8K7FGIce3wHti72NJPsi0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)