UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '42uiIfV4e6dsqJGFelwnKzjVt3T2L41MuKmctHZGBVI='
WHERE
key_id = '0c8c476523dd3dbaea8ae00b9a3cd4e260f743547a1317d7e5e067c090f8c29b'
AND (
token = '42uiIfV4e6dsqJGFelwnKzjVt3T2L41MuKmctHZGBVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)