UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SPWEQLqJMTAdERnYwGMZSrw7R2U0kaCz7Ip9HLtSkx4='
WHERE
key_id = '9492d2318486f38b99b4100eff2680447a903ebef63316a40fbf28c41e6d8d67'
AND (
token = 'SPWEQLqJMTAdERnYwGMZSrw7R2U0kaCz7Ip9HLtSkx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)