UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '28Ejk3Xnff1LWtM3KJgeySeOmjRko5+1t3GEykZfiio='
WHERE
key_id = '6864bf0b39a5d2e3001a267130e80c9387b7bddc0cd5ceb0ccf3e1059eedf16f'
AND (
token = '28Ejk3Xnff1LWtM3KJgeySeOmjRko5+1t3GEykZfiio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)