UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0haWSBwmK15wWphxQapJz4Ixzl068mH8kIl2u+rqk8o='
WHERE
key_id = '09c1c4a3bc2e35f98aef00d5d5d0944f8696142fd344bb0b8b2ae974134db6fd'
AND (
token = '0haWSBwmK15wWphxQapJz4Ixzl068mH8kIl2u+rqk8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)