UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b6VnXGui79M0vE4Uhi+EonJDPzZsi0WhUgQ70Weikp8='
WHERE
key_id = '136912db7166f62eee0e1e800590ff3424348c98f639cd61e10c86afbac3857c'
AND (
token = 'b6VnXGui79M0vE4Uhi+EonJDPzZsi0WhUgQ70Weikp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)