UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/7xChdZX87Qenjld4brWMNSBTi2bRh881P6HDH33Hdo='
WHERE
key_id = 'a97283d74c43b54da0f2f96ee8d0fbdc103f24ba5689b82b93f26fa14af329e0'
AND (
token = '/7xChdZX87Qenjld4brWMNSBTi2bRh881P6HDH33Hdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)