UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gx3+eUaNLGHOYHxEWqAgm5sDu8WJVbNkpZFJFer9JPk='
WHERE
key_id = 'ea0829baa6dbe17a1d1d893067169f3e3ec3635fae7d23b0a967de577c0d8a78'
AND (
token = 'Gx3+eUaNLGHOYHxEWqAgm5sDu8WJVbNkpZFJFer9JPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)