UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vV8xViulJUgMkFDBWPr8fGuIp86Qja5zhoRYdwglyZw='
WHERE
key_id = 'aa0382a3114147c212eb8605bf01d424a8ce9ea4f2a53769f6371271bc8a5a1c'
AND (
token = 'vV8xViulJUgMkFDBWPr8fGuIp86Qja5zhoRYdwglyZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)