UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+d9iRtu8tSEzUJmhQQhd0mKIeRHFDb4N+XiejpvJ95o='
WHERE
key_id = 'da3734dae8b04f696fc7cbfe67725576c98fab0fc11ad1410ff09e22a870d25d'
AND (
token = '+d9iRtu8tSEzUJmhQQhd0mKIeRHFDb4N+XiejpvJ95o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)