UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a/alcuB7Z68ejJ66hNek5o5pDNAwGc7Vuj4l9okAN50='
WHERE
key_id = 'b06d081b160f4076b9dc0d9af400ab7f38444ffb214a8934c9b76c033678b5b3'
AND (
token = 'a/alcuB7Z68ejJ66hNek5o5pDNAwGc7Vuj4l9okAN50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)