UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AwXM2I8HMMaW3JJYcw+bhHnd/wXjzMCCqdLQlbxKKBk='
WHERE
key_id = 'b8fb8526a34e6fe8200def6001634521cf4ccc54680ff48e48af279b122a3b1e'
AND (
token = 'AwXM2I8HMMaW3JJYcw+bhHnd/wXjzMCCqdLQlbxKKBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)