UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DL73jmNpcI4XLy9gfGsXVI3U8ZagfoB3+ilDw01jyA4='
WHERE
key_id = '9e22f5a3e152a1d86c59fa6569ac77cc142a64a90507c8ffbad5f3d3e55821e6'
AND (
token = 'DL73jmNpcI4XLy9gfGsXVI3U8ZagfoB3+ilDw01jyA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)