UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OM0Gp8r4L6t0/lbJK6DCljhfb2O/U8OKSDvOD/9gCis='
WHERE
key_id = '2d6aeb1fd0f84ad865828bd70d94f053f6ac17377294cf8d542a69b991526aef'
AND (
token = 'OM0Gp8r4L6t0/lbJK6DCljhfb2O/U8OKSDvOD/9gCis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)