UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8mqOJJTBe8lWH6GSKA0rGm/sogNrfE8gQ0IKq2OUfoU='
WHERE
key_id = '59554d312a2506965362f6a56fcb7cf4cb0d7330694cf01179913482d73360fd'
AND (
token = '8mqOJJTBe8lWH6GSKA0rGm/sogNrfE8gQ0IKq2OUfoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)