UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KkVkIpLbgtNHTvuwhS4JGKG76XURqKjxXH9a2zjD2+4='
WHERE
key_id = '4225beead1d13a6fb557fa489ea05c5ab00b8a3b2126f96f60d2a1f956e3db8f'
AND (
token = 'KkVkIpLbgtNHTvuwhS4JGKG76XURqKjxXH9a2zjD2+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)